#include"thread.hpp"
#include<vector>
using namespace threadModule;

#include <unordered_map>
#include <cstring>
#include <memory>

// #define num 10
struct threadData
{
    int start, end;
};
using thread_ptr= std::shared_ptr<Thread<threadData>>;

void count(threadData data)
{
    for (int i = data.start; i <= data.end; i++)
    {
        std::cout << "i == " << i << std::endl;
        sleep(1);
    }
}

int main()
{
    thread_ptr t = std::make_shared<Thread<threadData>>(count, threadData{1, 10});
    t->Running();
    std::cout << "Thread Name: " << t->getName() << std::endl;
    std::cout << "Thread ID: " << t->getTid() << std::endl;
    std::cout << "Process ID: " << t->getPid() << std::endl;   
    sleep(10);
    t->stop();
    t->join();
    std::cout << "Thread stopped and joined." << std::endl;
    return 0;
}